<div class="page-header">
	<h1>Danh mục tin tức</h1>
</div>
<?php
$url_form = !empty($page_index)?$this->config->item('admin_folder').'/news_category/bulk_save/'.$page_index:$this->config->item('admin_folder').'/news_category/bulk_save';
echo form_open($url_form, array('id'=>'bulk_form'));?>
	<table class="table table-striped">
		<thead>
			<tr>
				<th>ID</th>
                <th>Tên danh mục</th>
				<th>Trạng thái</th>
                <th>Số thứ tự hiển thị</th>
				<th>
					<span class="btn-group pull-right">
						<button class="btn" href="#"><i class="icon-ok"></i> Lưu tất cả </button>
						<a class="btn" style="font-weight:normal;"href="<?php echo site_url($this->config->item('admin_folder').'/news_category/edit');?>"><i class="icon-plus-sign"></i>Tạo mới</a>
					</span>
				</th>
                
			</tr>
		</thead>
		<tbody>
	<?php echo (count($model) < 1)?'<tr><td style="text-align:center;" colspan="7"> Hiện không có danh mục nào</td></tr>':''?>
	<?php foreach ($model as $item):?>
			<tr>
            	<td> <?php echo $item->id?></td>
				<td><?php echo form_input(array("name"=>"title[".$item->id."]","value"=>$item->title,"class"=>"span5"));?></td>
              
				<td>
					<?php
					 	$options = array(
			                  '1'	=> "Bật",
			                  '0'	=> "Tắt"
			                );

						echo form_dropdown('status['.$item->id.']', $options,set_value($item->status),'class="span2"');
					?>
				</td>
                <td><?php echo form_input(array("name"=>"ordering[".$item->id."]","value"=>$item->ordering,"class"=>"span2"));?></td>
				<td>
					<span class="btn-group pull-right">
						<a class="btn" href="<?php echo  site_url($this->config->item('admin_folder').'/news_category/edit/'.$item->id);?>"><i class="icon-pencil"></i>  <?php echo lang('edit');?></a>
						<a class="btn" href="<?php echo  site_url($this->config->item('admin_folder').'/news_category/copy_data/'.$item->id);?>"><i class="icon-share-alt"></i>Copy</a>
						<a class="btn btn-danger" href="<?php echo site_url($this->config->item('admin_folder').'/news_category/delete/'.$item->id);?>" onclick="return areyousure();"><i class="icon-trash icon-white"></i> <?php echo lang('delete');?></a>
					</span>
				</td>
			</tr>
	<?php endforeach; ?>
		</tbody>
	</table>
</form>
<script language="javascript">
	$(".btn-danger").click(function(){
		return confirm("Bạn có thật sự muốn xóa");
	});
</script>